<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
 
  <ui:composition template="/pages/templates/commonLayoutCli.xhtml">

	
	<ui:define name="content">

	<h:form>
		
		<center>
		
			<p:panel id="panelSolicitacoes" style="width:70%;align:center;valign:middle;">
				<h:panelGrid columns="2"  cellpadding="5" >
				
 
				<p:outputLabel value="Solicitações:" ></p:outputLabel>
				<p:selectOneMenu id="select" value="#{beanSolicitacoes.codigoSolicitacao}">
    				<p:ajax event="change" update="panelSolicitacoes" listener="#{beanSolicitacoes.carregarDadosSolicitacoes()}" />
    				<f:selectItem itemLabel="Selecione" itemValue="-1" noSelectionOption="true" />
    				<f:selectItems  value="#{beanSolicitacoes.solicitacoes}" var="solicitacao" itemLabel="#{beanSolicitacoes.formaStringSolicitacao(solicitacao)}"  itemValue="#{solicitacao.codigo}"/>
				</p:selectOneMenu>
				</h:panelGrid>
				


				<h:panelGrid columns="2" cellpadding ="5" style="width:60%;align:center;valign:middle;">
				
				<p:outputLabel for="data" value="Data:"  ></p:outputLabel>
				<p:inputText id="data" size="10" value="#{beanSolicitacoes.data}" readonly="true"></p:inputText>
	
				<p:outputLabel for="hora" value="Hora:" ></p:outputLabel>
				<p:inputText id="hora" size="10" value="#{beanSolicitacoes.hora}" readonly="true"></p:inputText>		
				
				<p:outputLabel for="prof" value="Profissional:" ></p:outputLabel>
				<p:inputText id="prof" size="50" value="#{beanSolicitacoes.profissional}" readonly="true"></p:inputText>	
				
			   <p:outputLabel value="Paciente:" ></p:outputLabel>
				<p:inputText id="nome" size="50" value="#{beanSolicitacoes.nome}" readonly="true"></p:inputText>
			   
			   <p:outputLabel value="CPF:" ></p:outputLabel>
				<p:inputText id="cpf" size="20" value="#{beanSolicitacoes.cpf}" readonly="true"></p:inputText>
				
				<p:outputLabel value="Idade:" ></p:outputLabel>
				<p:inputText id="idade" size="5" value="#{beanSolicitacoes.idade}" readonly="true"></p:inputText>
				
				<p:outputLabel value="Sexo:" ></p:outputLabel>
				<p:inputText id="sexo" size="10" value="#{beanSolicitacoes.sexo}" readonly="true"></p:inputText>
				
				<p:outputLabel value="Estado Civil:" ></p:outputLabel>
				<p:inputText id="estadoCivil" size="10" value="#{beanSolicitacoes.estadoCivil}" readonly="true"></p:inputText>
				
				<p:outputLabel value="Profissão:" ></p:outputLabel>
				<p:inputText id="profissao" size="50" value="#{beanSolicitacoes.profissao}" readonly="true"></p:inputText>
				
				<p:outputLabel value="Endereço:" ></p:outputLabel>
				<p:inputText id="endereco" size="50" value="#{beanSolicitacoes.endereco}" readonly="true"></p:inputText>

				
				<p:outputLabel value="Número:" ></p:outputLabel>
				<p:inputText id="numero" size="5" value="#{beanSolicitacoes.numero}" readonly="true"></p:inputText>

				
				<p:outputLabel value="Complemento:" ></p:outputLabel>
				<p:inputText id="complemento" size="20" value="#{beanSolicitacoes.complemento}" readonly="true"></p:inputText>

				
				<p:outputLabel value="Bairro:" ></p:outputLabel>
				<p:inputText id="bairro" size="20" value="#{beanSolicitacoes.bairro}" readonly="true"></p:inputText>

				
				<p:outputLabel value="Cidade:" ></p:outputLabel>
				<p:inputText id="cidade" size="20" value="#{beanSolicitacoes.cidade}" readonly="true" ></p:inputText>

				
				<p:outputLabel value="Estado:" ></p:outputLabel>
				<p:inputText id="estado" size="20" value="#{beanSolicitacoes.estado}" readonly="true" ></p:inputText>	
				
				<p:outputLabel value="Telefone:" />
        		<p:inputText id="telefone" size="20" value="#{beanSolicitacoes.telefone}" readonly="true" ></p:inputText>
					
				
			</h:panelGrid>	
			
			<p:confirmDialog id="myDialogID" widgetVar="dialogsol" header="Advertência" severity="alert" message="#{beanSolicitacoes.msgErro}" >
			</p:confirmDialog>	
			
			<p:commandButton value="Aceitar" action="#{beanSolicitacoes.criarConsulta()}" update="panelSolicitacoes">
			  </p:commandButton>
								
				<p:commandButton value="Rejeitar" action="#{beanSolicitacoes.rejeitarSolicitacao()}" update="panelSolicitacoes">

				</p:commandButton>
			
			</p:panel>
		</center>
	
	</h:form>
</ui:define>

</ui:composition>

</html>